package cn.xiaolang.function.design_pattern.publish_observer;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 观察者的具体实现
 *
 * @author fuhw/Dean
 * @date 2020-04-07
 */
@Slf4j
public class ConcreteObserver implements Observer {

    private static AtomicInteger count = new AtomicInteger(0);

    @Override
    public void update(String message) {
        int no = count.incrementAndGet();
        log.info("No.{}获取到消息：{}", no, message);

    }

}
